package servic.impl;

import java.util.List;

import dao.CustomerDao;
import dao.CustomerDaoImpl;
import pojo.Customer;
import service.CustomerManager;

public class CustomerManagerImpl implements CustomerManager {
	private CustomerDao customerDao;
	
	public CustomerManagerImpl(){
		customerDao = new CustomerDaoImpl();
	}

	@Override
	public int addCustomer(Customer c) {
		int m=customerDao.addCustomer(c);
		if(m>0){
			return 1;
		}else{
			return 0;
		}
		
	}

	@Override
	public List<Customer> findAllCustomers() {
		List<Customer> list=customerDao.findAllCustomers();
		return list;
	}

	@Override
	public int updateCustomer(Customer c) {
		// TODO Auto-generated method stub
		int m=customerDao.updateCustomer(c);
		if(m>0){
			return 1;
		}else {
			return 0;
		}
	}

	@Override
	public int deleteCustomer(Integer id) {
		// TODO Auto-generated method stub
		int m =customerDao.deleteCustomer(id);
		if(m>0){
			return 1;
		}else{
			return 0;
		}
	}

	@Override
	public String[] getCustomerHobby(Integer id) {
		// TODO Auto-generated method stub
		String[] hobby = customerDao.getCustomerHobby(id);
		return hobby;
	}

}
